#include "../stdafx.h"

namespace Threading
{

Mutex::Mutex() :
	_mutexHandler(CreateMutex(NULL, FALSE, NULL))
{

}

Mutex::~Mutex()
{
	CloseHandle(_mutexHandler);
}

void Mutex::lock()
{
	WaitForSingleObject(_mutexHandler, INFINITE);
}

void Mutex::unlock()
{
	ReleaseMutex(_mutexHandler);
}

}
